<?php $this->_extends('_layouts/bocib_layout'); ?>

<?php $this->_block('content');?>
<div id="content">
    <h2>现有部门</h2>
    <table style="margin-left:95px;">
        <tr>
            <th class="id">分类</th>
            <th class="major">部门</th>
            <th class="edit">更新</th>
            <th class="delete">删除</th>
        </tr>
        <?php foreach(Major::find()->all()->query() as $major) { ?>
        <tr>
            <td><?=$major->major_id;?></td>
            <td><?=$major->major;?></td>
            <td><a href="<?=url('bofaculty/editmajor', array('major_id'=>$major->major_id));?>">更新名称</a></td>
            <td><a href="<?=url('bofaculty/deletemajor', array('major_id'=>$major->major_id));?>">删除</a></td>
        </tr>
        <?php } ?>
    </table>
    <form action="<?=url('bofaculty/addmajor');?>" method="post">
        <div>
            <label for="new_major">添加新部门</label>
            <input type="text" name="new_major" id="new_major" />
            <input type="submit" value="提交" />
        </div>
    </form>
</div>
<?php $this->_endblock('content');?>